package com.baizhiedu.baizhiappsys.controller;

import com.baizhiedu.baizhiappsys.service.AdminAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Map;

/**
 * @author lby
 * 管理员登录
 */
@RequestMapping("admin")
@Controller
public class AdminController {
    @Autowired
    private AdminAccountService adminAccountService;


    @RequestMapping("adminLogin")
    public String adminLogin(String password,String username){
        Map map = adminAccountService.adminLogin(username, password);
        Boolean msg = (boolean)map.get("msg");

        if(msg){
            return "redirect:/index.html";
        }else {
            return "redirect:/login.html";
        }

    }
}
